//菜单模块管理
import request from "@/utlis/request";

enum API {
  FINDMENUTREE_URL = "/menu/findMenuTree", //查询树组件
  FINDNAVTREE_URL = "/menu/findNavTree", //查询该用户的菜单
  SAVEMENU_URL = "/menu/save", //新增菜单
  DELETEMENU_URL = "/menu/delete", //删除菜单
}

export const reqFindMenuTree = async () => {
  return request.get<any, any>(API.FINDMENUTREE_URL);
};

export const reqFindNavTree = async (data: any) => {
  return request.post<any, any>(API.FINDNAVTREE_URL, data);
};

export const reqMenuSave = async (data: any) => {
  return request.post<any, any>(API.SAVEMENU_URL, data);
};

export const reqMenuDelete = async (data: any) => {
  return request.post<any, any>(API.DELETEMENU_URL, data);
};
